package com.project.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.project.bean.SupplierBean;
import com.project.bean.SupplyBean;
import com.project.mapper.ISupplyMapper;
import com.project.service.ISupplierService;
import com.project.service.ISupplyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.transaction.Transactional;

@Service
@Transactional
public class SupplyServiceImpl implements ISupplyService {
    @Autowired
    private ISupplyMapper supplyMapper;
    @Override
    public void updateStatus(String batch, String status) {
        QueryWrapper<SupplyBean> qw = new QueryWrapper<>();
        qw.eq("s_batch",batch);
        SupplyBean supplyBean = supplyMapper.selectOne(qw);
        supplyBean.setStatus(status);
        supplyMapper.updateById(supplyBean);
    }
}
